﻿<UserControl x:Class="Samba.Modules.UserModule.UserView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:Common="clr-namespace:Samba.Presentation.Common;assembly=Samba.Presentation.Common" mc:Ignorable="d" d:DesignHeight="300"
     d:DesignWidth="300">
    <Grid>
        <StackPanel>
            <Label Content="{LocText UserName, Suffix=':'}" />
            <TextBox HorizontalAlignment="Left" MinWidth="200" Text="{Binding Name,ValidatesOnDataErrors=True}">
            </TextBox>
            <Label Content="{LocText PinCode, Suffix=':'}" />
            <Common:FilteredTextBox Name="PasswordTextBox" Type="Digits" HorizontalAlignment="Left" Text="{Binding PinCode,Mode=TwoWay}" MinWidth="100" />
            <Label Content="{LocText UserRole, Suffix=':'}" />
            <ComboBox HorizontalAlignment="Left" MinWidth="100" ItemsSource="{Binding Roles}"
                 SelectedItem="{Binding Role}">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding Name}" />
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
            <Button HorizontalAlignment="Left" Margin="0,10" MinWidth="70" Content="{Binding SaveCommand.Caption}"
                 Command="{Binding SaveCommand}" />
            <Label Content="{Binding Error}" Foreground="Red" />
        </StackPanel>
    </Grid>
</UserControl>